翻訳と辞書
Words near each other
・ Disparithelphusa
・ Disparity
・ Disparity filter algorithm of weighted network
・ Disparity of worship
・ Disparo al Corazón
・ Disparoneura
・ Dispase
・ Dispatch
・ Dispatch (band)
・ Dispatch (EP)
・ Dispatch (logistics)
・ Dispatch (sternwheeler)
・ Dispatch boat
・ Dispatch Broadcast Group
・ Dispatch News Service
Dispatch table
・ Dispatch, Kansas
・ Dispatchable generation
・ Dispatched
・ Dispatched labor
・ Dispatcher
・ Dispatcher training simulator
・ Dispatches (book)
・ Dispatches (magazine)
・ Dispatches (radio program)
・ Dispatches (TV series)
・ Dispatches from the Edge
・ Dispegatrine
・ Dispensa's Castle of Toys
・ Dispensary


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Dispatch table : ウィキペディア英語版
Dispatch table
In computer science, a dispatch table is a table of pointers to functions or methods. Use of such a table is a common technique when implementing late binding in object-oriented programming.
==Perl implementation==
The following shows one way to implement a dispatch table in Perl, using a hash to store references to code (also known as function pointers).

#define the table using one anonymous code-ref and one named code-ref
my %dispatch = (
"-h" => sub ,
"-g" => \&say_goodbye
);

sub say_goodbye

#fetch the code ref from the table, and invoke it
my $sub = $dispatch;
print $sub ? $sub->() : "unknown argument\n";

Running this Perl program as perl greet -h will produce "hello", and running it as perl greet -g will produce "goodbye".

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Dispatch table」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.